/*
 * system.cpp
 *
 *  Created on: 2016年2月25日
 *      Author: Administrator
 */

#include "system.h"

#if !defined (_WIN32) && !defined (_WIN64)
#define LINUX
//#include <sysconf.h>
#include <unistd.h>
#else
#define WINDOWS
#include <windows.h>
#endif

namespace eyas{
namespace system{

unsigned int get_cpu_core_count(){
	unsigned int count = 1; // 至少一个
#if defined (LINUX)
	count = sysconf(_SC_NPROCESSORS_CONF);
#elif defined (WINDOWS)
	SYSTEM_INFO si;
	GetSystemInfo(&si);
	count = si.dwNumberOfProcessors;
#endif
	return count;
}

}
}
